/**
 * Created by wenchuan.li 2018/4/27.
 */
define(function () {

    var self, app = win.app, user;

    var Index = app.Module.extend({

        init: function () {
            self = this;
            self._super({}, win);
            self.data = {
                items: [
                ]
            };
            self.getTypes();

            mui.ready(function () {
                new Vue({
                    el: app.getByid(doc, 'content'),
                    data: self.data,
                    methods: {
                        openWindow: function (code) {
                            var args = {};
                            switch (code) {
                                case 'fl':
                                    args.src = "yxsjxd/classes.html";
                                    break;
                                case 'zc':
                                    args.src = "yxsjxd/order-temp.html";
                                    break;
                            }
                            app.openPage(args);
                        }
                    }
                });
            });
        },
        getTypes: function () {
            app.ajax({
                xurl: "api/wx/gwat100/getGwahData",
                xdata: {},
                cb: function (result) {
                    if (result.ok) {
                        var items = result.data.data;
                        //self.data.sub.gwaa017 = provinces[0].gwad002;
                        self.data.items.pushArray(items);
                    }
                }
            });
        },
        _lazy: function () {

        }
    });

    new Index();

});